package com.lw.service.impl;

import com.mybatisflex.spring.service.impl.ServiceImpl;
import com.lw.entity.TbRole;
import com.lw.mapper.TbRoleMapper;
import com.lw.service.TbRoleService;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.stereotype.Service;

import java.util.ArrayList;
import java.util.List;

/**
 *  服务层实现。
 *
 * @author lw
 * @since 2024年08月03日 17:30:24
 */
@Service
@Cacheable(cacheNames ="myEhCache" )
public class TbRoleServiceImpl extends ServiceImpl<TbRoleMapper, TbRole> implements TbRoleService {


    @Cacheable(value = "getRoleIds")
    @Override
    public List<String> getRoleIds(String loginId) {
        List<TbRole> list = list();
        List<String> result = new ArrayList<>();
        for (TbRole role : list) {
            result.add(role.getName());
        }
        return result;
    }
}
